package com.xiaoyin.community.Test;

/**
 * Created by yinjianping@baidu.com on 2018/8/13.
 *
 * @Description:
 * @Modified By:
 */
public class MaoPao {
    public static void main(String[] args) {
        int [] arr = {5,4,3,2,10};
        sort(arr);
        for (int i=0;i<arr.length;i++){
            System.out.println(arr[i]);
        }
    }
    public static void sort(int[] arr){
        for(int i=0;i<arr.length;i++){
            for(int j=0;j<arr.length-i-1;j++){
                if (arr[j]>arr[j+1]) {
                    int temp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = temp;
                }
            }
        }
    }
}
